#include <string>
#include "defangIPaddr.h"
using namespace std;
string defangIPaddr(string address) {
        int n = address.length();
        for(int i=0;i<n;){
            if(address.at(i) == '.'&&i<n){
                address.replace(i,1,"[.]");
                i+=3;
                n+=2;
            }else
                i+=1;

        }
        return address;
    }
